#import "YYText.h"
#import "dfhgwhruebvhrheyavenuetyre.h"
#import "dfhgwhruebvhrheyadmitultimate.h"
#import "dfhgwhruebvhrheyoutwarddelegate.h"
#import "FSPagerView-Swift.h"
#import "dfhgwhruebvhrheyobsceneinject.h"
#import "dfhgwhruebvhrheybangorganismViewController.h"
#import "dfhgwhruebvhrheywarrantfeasibleViewController.h"
#import "dfhgwhruebvhrheydefinitelyleakViewController.h"
#import "dfhgwhruebvhrheynamelyprevalentViewController.h"
@interface dfhgwhruebvhrheyobsceneinject () <FSPagerViewDataSource>
@property (weak, nonatomic) IBOutlet FSPagerView *marqueeView;
@property (nonatomic, strong) dfhgwhruebvhrheyadmitultimate *homeModel;
@property (weak, nonatomic) IBOutlet UILabel *amountText;
@property (weak, nonatomic) IBOutlet UILabel *termText;
@property (weak, nonatomic) IBOutlet UIButton *applyBtn;
@end
@implementation dfhgwhruebvhrheyobsceneinject {
    NSArray<dhgfywegwygeydwqueuememorial *> *marquees;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    [self configureUI];
}
- (void)linkClickAt:(int)idx {
    dfhgwhruebvhrheybangorganismViewController *webVC = [[dfhgwhruebvhrheybangorganismViewController alloc] init];
    webVC.isShowBottomView = NO;
    if (idx == 1) {
        [webVC loadURLString:howToLoanH5];
        webVC.navigationItem.title = @"How To Loan?";
    }else {
        [webVC loadURLString:loanTermsH5];
        webVC.navigationItem.title = @"Loan Term";
    }
    webVC.hidesBottomBarWhenPushed = YES;
    [self.controller.navigationController pushViewController:webVC animated:YES];
}
- (void)configureUI {
    self.marqueeView.isInfinite = YES;
    self.marqueeView.dataSource = self;
    self.marqueeView.userInteractionEnabled = NO;
    self.marqueeView.automaticSlidingInterval = 2;
    self.marqueeView.scrollDirection = ScrollDirectionVertical;
    [self.marqueeView registerClass:[FSPagerViewCell class] forCellWithReuseIdentifier:@"cell"];
    self.applyBtn.layer.cornerRadius = 12;
    self.applyBtn.backgroundColor = primary_color.dhgfywegwygeydwlearneddesignate;
    self.amountText.textColor = primary_color.dhgfywegwygeydwlearneddesignate;
}
- (void)bindData:(dfhgwhruebvhrheyadmitultimate *)model {
    self.homeModel = model;
    marquees = model.carousel_text;
    [self.marqueeView reloadData];
    self.termText.text = @"Loan period : 91-210 days";
    self.amountText.text = [NSString stringWithFormat:@"%@ PHP", model.max_money.dhgfywegwygeydwlocalitylearned];
}
- (IBAction)btnsClick:(UIButton *)sender {
    if (self.homeModel.status == 0 || ![dfhgwhruebvhrheyoptionsaving isLogin]) {
        [dfhgwhruebvhrheyoptionsaving login:nil];
    }else {
        [dfhgwhruebvhrheyavenuetyre addTracking:apply_now_time withValue:0 byType:1];
        [dfhgwhruebvhrheyavenuetyre addTracking:basic_confirm_duration withValue:0 byType:1];
        if (self.homeModel.state_two == 1) {
            if (self.homeModel.state_one != 1) {
                dfhgwhruebvhrheywarrantfeasibleViewController *identity = (dfhgwhruebvhrheywarrantfeasibleViewController *)[UIStoryboard storyboard:@"Home" withidentifier:@"identity"];
                identity.hidesBottomBarWhenPushed = YES;
                [self.controller.navigationController pushViewController:identity animated:YES];
            }else {
                dfhgwhruebvhrheynamelyprevalentViewController *center = (dfhgwhruebvhrheynamelyprevalentViewController *)[UIStoryboard storyboard:@"Home" withidentifier:@"authentication"];
                center.hidesBottomBarWhenPushed = YES;
                [self.controller.navigationController pushViewController:center animated:YES];
            }
        }else {
            NSString *identifier = [[NSUserDefaults standardUserDefaults] stringForKey:[NSString stringWithFormat:@"%@_%@", [dfhgwhruebvhrheyoptionsaving getUserData].phone, dhgfywegwygeydwconnectionencounter]];
            if (identifier.length) {
                dfhgwhruebvhrheychemistcandidateViewController *identifierVC = [UIStoryboard storyboard:@"Home" withidentifier:identifier];
                identifierVC.hidesBottomBarWhenPushed = YES;
                [self.controller.navigationController pushViewController:identifierVC animated:YES];
            }else {
                dfhgwhruebvhrheydefinitelyleakViewController *basicinfo = (dfhgwhruebvhrheydefinitelyleakViewController *)[UIStoryboard storyboard:@"Home" withidentifier:@"basic_info"];
                basicinfo.hidesBottomBarWhenPushed = YES;
                [self.controller.navigationController pushViewController:basicinfo animated:YES];
            }
        }
    }
}
- (NSInteger)numberOfItemsInPagerView:(FSPagerView *)pagerView {
    return marquees.count;
}
- (FSPagerViewCell *)pagerView:(FSPagerView *)pagerView cellForItemAtIndex:(NSInteger)index {
    FSPagerViewCell *cell = [pagerView dequeueReusableCellWithReuseIdentifier:@"cell" atIndex:index];
    cell.contentView.layer.shadowColor = [UIColor clearColor].CGColor;
    cell.textLabel.superview.backgroundColor = [UIColor clearColor];
    cell.textLabel.font = [UIFont systemFontOfSize:13];
    cell.textLabel.text = marquees[index].name;
    return cell;
}
@end
